<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class person {
            constructor(name, age) {
                this.name = name
                this.age = age
            }

            sing() {
                console.log();
            }
        }

        let zy = new person('周瑜', 18)
        console.log(zy.name);
        console.log(zy.age);


        class Father {
            constructor(x, y) {
                this.x = x
                this.y = y
            }

            sum() {
                console.log(this.x + this.y);
            }
        }

        class Son extends Father {
            constructor(x, y, z) {
                super(x, y)
                this.z = z
                console.log(this.x + this.y + this.z);

            }
            sum1() {
                console.log(this.x + this.z);
            }
        }

        let son = new Son(1, 2, 3)
        let father = new Father(3, 4)
        son.sum()
        son.sum1()
        father.sum()
    </script>
</body>

</html>